<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>08元素的内容操作</title>
  <style>
    * {
      padding: 0;
      /* property */
      margin: 0;
    }
    #div {
      /* background: green; */
    }
  </style>
</head>
<body>
  <!-- attribute attr -->
  <input id="input" type="text" data-id="100" class="a1 a2 a3" value="abc">
  <div id="div">
    12121212
    <div>aaaaa</div>
    <div>bbbbb</div>
  </div>
</body>
<script>
  //可读可写
  // value 获取和设置表单元素的内容
  // innerText 获取和设置非表单元素的文本内容
  // innerHTML 获取和设置非表单元素的标签内容

  // var oInput = document.getElementById("input");

  // // console.log(oInput.value);
  // oInput.value = "123";

  var oDiv = document.getElementById("div");

  // oDiv.innerText = "888";

  // oDiv.innerHTML = "<h1>888</h1>"
  // oDiv.innerHTML = "";

  console.log(oDiv.innerText);
  console.log(oDiv.innerHTML);

  


  

</script>

</html>